package com.didd.core.common.utils;

import org.slf4j.Logger;

/**
 * @author diddd
 * @date 2019/07/12
 */
public class LoggerUtil {

    public static void error(Logger logger, String s) {
        if (logger.isErrorEnabled()) {
            logger.error(" [DIDDD] " + s);
        }
    }

    public static void error(Logger logger, String s, Thread e) {
        if (logger.isErrorEnabled()) {
            logger.error(" [DIDDD] " + s, e);
        }
    }

    public static void error(Logger logger, String s, Object ... objects) {
        if (logger.isErrorEnabled()) {
            logger.error(" [DIDDD] " + s, objects);
        }
    }

    public static void error(Logger logger, String s, Thread e, Object ... objects) {
        if (logger.isErrorEnabled()) {
            logger.error(" [DIDDD] " + s, objects, e);
        }
    }

    public static void info(Logger logger, String s) {
        if (logger.isInfoEnabled()) {
            logger.error(" [DIDDD] " + s);
        }
    }

    public static void info(Logger logger, String s, Thread e) {
        if (logger.isInfoEnabled()) {
            logger.error(" [DIDDD] " + s, e);
        }
    }

    public static void info(Logger logger, String s, Object ... objects) {
        if (logger.isInfoEnabled()) {
            logger.error(" [DIDDD] " + s, objects);
        }
    }

    public static void info(Logger logger, String s, Thread e, Object ... objects) {
        if (logger.isInfoEnabled()) {
            logger.error(" [DIDDD] " + s, objects, e);
        }
    }

    public static void warn(Logger logger, String s) {
        if (logger.isWarnEnabled()) {
            logger.error(" [DIDDD] " + s);
        }
    }

    public static void warn(Logger logger, String s, Thread e) {
        if (logger.isWarnEnabled()) {
            logger.error(" [DIDDD] " + s, e);
        }
    }

    public static void warn(Logger logger, String s, Object ... objects) {
        if (logger.isWarnEnabled()) {
            logger.error(" [DIDDD] " + s, objects);
        }
    }

    public static void warn(Logger logger, String s, Thread e, Object ... objects) {
        if (logger.isWarnEnabled()) {
            logger.error(" [DIDDD] " + s, objects, e);
        }
    }

}
